/**
 * Thread qui permet d'afficher le temps restant aux joueurs
 * @author Christophe BROCHARD
 */
package Game;

public class ThreadChronoTimer extends Thread{
	Round round;
	boolean redemarrage;
	
	public ThreadChronoTimer(Round round){
		this.round = round;
		redemarrage = true;
	}
	
	public void run(){
		while(!isInterrupted()){
			if(redemarrage)
				round.remainingTime(15, 30);
			if(redemarrage)
				round.remainingTime(15, 15);
			if(redemarrage)
				round.remainingTime(10, 5);
			if(redemarrage)
				round.remainingTime(1, 4);
			if(redemarrage)
				round.remainingTime(1, 3);
			if(redemarrage)
				round.remainingTime(1, 2);
			if(redemarrage)
				round.remainingTime(1, 1);
			if(redemarrage)
				round.finishRound();
			redemarrage = true;
		}
	}
	
	public void nouveauTimer(){ redemarrage = false; }
	public boolean isRebooting(){ return redemarrage; }
	
}
